package com.naiterui.ehp.bs.emr.feign;

import com.naiterui.ehp.bp.bo.emr.AddPatientRecordInitializeBO;
import com.naiterui.ehp.bp.bo.patient.*;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @Description 患者服务接口
 * @Author gongbaoqiang
 * @Date 2019/11/28 2:28 PM
 */
@ApiIgnore
@RequestMapping("inner")
@FeignClient(name = "emrAp", url = "${ehp.domain.ap}", configuration = FeignConfiguration.class)
public interface IPatientFeignClient {


    @PostMapping("patient/base")
    PatientBO getBaseInfo(@RequestParam("patientId") Long patientId) throws BusinessException;

    /**
     * <pre>
     *     根据您media_id下载并生成图片地址
     * </pre>
     *
     * @param list
     *
     * @return
     *
     * @throws BusinessException
     */
    @PostMapping("wx/convert/image")
    List<ConvertWxImageBO> getDiseaseImgs(@RequestBody List<ConvertWxImageBO> list) throws BusinessException;


    /**
     * 获取家庭成员关系
     * @param familyId
     * @return
     * @throws BusinessException
     */
    @GetMapping("family/detail")
    FamilyBO getPatientFamily(@RequestParam("familyId") Long familyId) throws BusinessException;

    /**
     * 获取就诊人信息
     * @param inquirerIds
     * @return
     * @throws BusinessException
     */
    @PostMapping("patient/inquirer/list")
    List<PatientInquirerBO> getPatientInquirer(@RequestBody List<Long> inquirerIds) throws BusinessException;

    /**
     * 查询患者指定关系的就诊人
     * @param patientId
     * @param relation
     * @return
     * @throws BusinessException
     */
    @PostMapping("patient/inquirer/list/by/relation")
    List<PatientInquirerBO> getPatientInquirerByRelation(@RequestParam("patientId") Long patientId, @RequestParam("relation") Integer relation) throws BusinessException;


    @GetMapping("patient/inquirer/record/initialize")
    AddPatientRecordInitializeBO getAddRecordInitializerInfo(@RequestParam("inquirerId") Long inquirerId, @RequestParam("sessionId") String sessionId);

    /**
     * 小程序消息
     * @param publishParamBO
     * @return
     */
    @PostMapping("message/ma/publish")
    MsgPublishBO publishMaMessage(@RequestBody MsgMaPublishParamBO publishParamBO);

    /**
     * 根据身份证号查询就诊人id列表
     *
     * @param idcard
     * @return
     */
    @GetMapping("patient/inquirer/inquirerIds")
    List<Long> getInquirerIdsByIdcard(@RequestParam("idcard") String idcard);
}
